VERSION 5.00
Begin VB.Form SetParaDlg 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "采集参数设置"
   ClientHeight    =   3915
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   5550
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3915
   ScaleWidth      =   5550
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      Caption         =   "视频源"
      Height          =   735
      Left            =   2640
      TabIndex        =   15
      Top             =   120
      Width           =   2775
      Begin VB.OptionButton Option2 
         Caption         =   "S-Video"
         Height          =   255
         Left            =   1560
         TabIndex        =   17
         Top             =   360
         Width           =   975
      End
      Begin VB.OptionButton Option1 
         Caption         =   "复合视频"
         Height          =   195
         Left            =   240
         TabIndex        =   16
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Frame StandardFr 
      Caption         =   "制式选择"
      Height          =   735
      Left            =   120
      TabIndex        =   12
      Top             =   120
      Width           =   2175
      Begin VB.OptionButton PAL 
         Caption         =   "PAL"
         Height          =   255
         Left            =   240
         TabIndex        =   14
         Top             =   360
         Width           =   975
      End
      Begin VB.OptionButton NTSC 
         Caption         =   "NTSC"
         Height          =   255
         Left            =   1200
         TabIndex        =   13
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.Frame SKIPFr 
      Caption         =   "采集方式"
      Height          =   735
      Left            =   120
      TabIndex        =   9
      Top             =   3000
      Width           =   5295
      Begin VB.OptionButton OnFrame 
         Caption         =   "按帧采集"
         Height          =   195
         Left            =   360
         TabIndex        =   11
         Top             =   360
         Width           =   1095
      End
      Begin VB.OptionButton OnField 
         Caption         =   "按场采集"
         Height          =   255
         Left            =   2760
         TabIndex        =   10
         Top             =   330
         Width           =   1335
      End
   End
   Begin VB.Frame MemFmtFr 
      Caption         =   "显示方式"
      Height          =   735
      Left            =   120
      TabIndex        =   5
      Top             =   2040
      Width           =   5295
      Begin VB.OptionButton DirectX 
         Caption         =   "DirectX方式"
         Height          =   255
         Left            =   360
         TabIndex        =   8
         Top             =   330
         Width           =   1215
      End
      Begin VB.OptionButton GDI 
         Caption         =   "GDI方式"
         Height          =   195
         Left            =   1980
         TabIndex        =   7
         Top             =   360
         Width           =   1095
      End
      Begin VB.OptionButton DirectShow 
         Caption         =   "直接显存方式"
         Enabled         =   0   'False
         Height          =   195
         Left            =   3480
         TabIndex        =   6
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.Frame ChannelFr 
      Caption         =   "通道选择"
      Height          =   735
      Left            =   120
      TabIndex        =   0
      Top             =   1080
      Width           =   5295
      Begin VB.OptionButton Channel1 
         Caption         =   "通道1"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   360
         Width           =   855
      End
      Begin VB.OptionButton Channel2 
         Caption         =   "通道2"
         Height          =   255
         Left            =   1560
         TabIndex        =   3
         Top             =   360
         Width           =   855
      End
      Begin VB.OptionButton Channel3 
         Caption         =   "通道3"
         Height          =   255
         Left            =   2760
         TabIndex        =   2
         Top             =   360
         Width           =   855
      End
      Begin VB.OptionButton Channel4 
         Caption         =   "通道4"
         Height          =   255
         Left            =   3960
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
   End
End
Attribute VB_Name = "SetParaDlg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim res As Boolean
Dim S1 As Integer
Dim S2 As Integer
Dim S3 As Integer
Dim S4 As Integer
Dim S5 As Integer
Option Explicit

Private Sub Channel1_Click()
res = Form1.MVDEVICE1.SetVideoChannel(0, 0)
S1 = 0
Channel1.Value = True
Form1.Refresh
End Sub

Private Sub Channel2_Click()
res = Form1.MVDEVICE1.SetVideoChannel(0, 1)
S1 = 1
Channel2.Value = True
Form1.Refresh
End Sub

Private Sub Channel3_Click()
res = Form1.MVDEVICE1.SetVideoChannel(0, 2)
S1 = 2
Channel3.Value = True
Form1.Refresh
End Sub

Private Sub Channel4_Click()
res = Form1.MVDEVICE1.SetVideoChannel(0, 3)
S1 = 3
Channel4.Value = True
Form1.Refresh
End Sub

Private Sub DirectShow_Click()
res = Form1.MVDEVICE1.SetBufferType(0, 2)
S4 = 2
Form1.Refresh
End Sub

Private Sub DirectX_Click()
res = Form1.MVDEVICE1.SetBufferType(0, 0)
S4 = 0
Form1.Refresh
End Sub

Private Sub Form_Initialize()
S1 = 0
S2 = 0
S3 = 0
S4 = 0
S5 = 0
End Sub

Private Sub Form_Load()
Select Case S1
Case 0: Channel1.Value = True
Case 1: Channel2.Value = True
Case 2: Channel3.Value = True
Case 3: Channel4.Value = True
End Select

Select Case S2
Case 0: PAL.Value = True
Case 1: NTSC.Value = True
End Select

Select Case S3
Case 0: OnFrame.Value = True
Case 1: OnField.Value = True
End Select

Select Case S4
Case 0: DirectX.Value = True
Case 1: GDI.Value = True
Case 2: DirectShow.Value = True
End Select

Select Case S5
Case 0: Option1.Value = True
Case 1: Option2.Value = True
End Select
End Sub

Private Sub GDI_Click()
res = Form1.MVDEVICE1.SetBufferType(0, 1)
S4 = 1
Form1.Refresh
End Sub

Private Sub NTSC_Click()
res = Form1.MVDEVICE1.SetVideoStandard(0, 1)
S2 = 1
Form1.Refresh
End Sub

Private Sub OnField_Click()
res = Form1.MVDEVICE1.SetCaptureAsField(0, True)
S3 = 1
Form1.Refresh
End Sub

Private Sub OnFrame_Click()
res = Form1.MVDEVICE1.SetCaptureAsField(0, False)
S3 = 0
Form1.Refresh
End Sub

Private Sub Option1_Click()
res = Form1.MVDEVICE1.SetVideoSource(0, 0)
S5 = 0
Form1.Refresh
End Sub

Private Sub Option2_Click()
res = Form1.MVDEVICE1.SetVideoSource(0, 1)
S5 = 1
Form1.Refresh
End Sub

Private Sub PAL_Click()
res = Form1.MVDEVICE1.SetVideoStandard(0, 0)
res = Form1.MVDEVICE1.SetCaptureSample(0, SetSizeDlg.InWidth.Text, SetSizeDlg.InHeight.Text)
res = Form1.MVDEVICE1.SetVideoSample(0, SetSizeDlg.DispWidth.Text, SetSizeDlg.DispHeight.Text)
S2 = 0
Form1.Refresh
End Sub
